﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <link rel="stylesheet" href="../static/css/powerstyle.css" />
    <link rel="stylesheet" href="../static/css/bootstrap.min.css">
    <style>
    p{margin:0;}
    </style>
</head>
<body>
<div class="table_div" id="power_admin" style="display: none;">
    <div class="table_top">
        <div class="row-fluid bot-dot  m-b-10">
                    <div class="span2 spanyi font1">角色名称:</div>
                    <div class="span10">
                        
                        <select placeholder="角色名称" class="card-input" id="" value="">
                                <option>超级管理员</option>
                                <option>客户管理员</option>
                                <option>普通用户</option>
                        </select>                                  </div>
                </div>
                <div class="row-fluid bot-dot">
    <div class="span2 spaner font1" style="margin-top: 10px;">权限明细</div>
    <div class="span10">
        <table class="table_ table-color" border=0 frame=void >
        <tr>
            <td class="font1">客户管理</td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="aClient" disabled="disabled"/><label>添加客户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="sClient" disabled="disabled"/><label>查询客户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="uClient" disabled="disabled"/><label>修改客户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="dClient" disabled="disabled"/><label>删除客户</label></p></td>
        </tr>
        <tr>
            <td class="font1">用户管理</td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="aUser" disabled="disabled"/><label>添加用户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="sUser" disabled="disabled"/><label>查询用户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="uUser" disabled="disabled"/><label>修改用户</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="dUser" disabled="disabled"/><label>删除用户</label></p></td>
        </tr>
        <tr>
            <td class="font1">场站管理</td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="aStation" disabled="disabled"/><label>添加场站</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="sStation" disabled="disabled"/><label>查询场站</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="uStation" disabled="disabled"/><label>修改场站</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="dStation" disabled="disabled"/><label>删除场站</label></p></td>
        </tr>
        <tr>
            <td class="font1">车辆管理</td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="aCar" disabled="disabled"/><label>添加车辆</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="sCar" disabled="disabled"/><label>查询车辆</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="uCar" disabled="disabled"/><label>修改车辆</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="dCar" disabled="disabled"/><label>删除车辆</label></p></td>
        </tr>
        <tr>
            <td class="font1">设备管理</td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" id="aShebei" disabled="disabled"/><label>添加设备</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="sShebei" disabled="disabled"/><label>查询设备</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="uShebei" disabled="disabled"/><label>修改设备</label></p></td>
            <td><p class="pos-re"><input type="checkbox" class="checkPower" name="vehicle" value="" id="dShebei" disabled="disabled"/><label>删除设备</label></p></td>
        </tr>
        </table>
    </div>
</div>
    </div>
    
<div class="table_div" id="power_client" style="display: none;">
    <p class="table_top">
        客户管理员&nbsp;&nbsp;&nbsp;权限一览
    </p>
    <table class="table_">
        <tr class="biaoti">
            <td align="center">&nbsp;</td>
            <td>添加</td>
            <td>查询</td>
            <td>修改</td>
            <td>删除</td>
        </tr>
        <tr>
            <td>客户管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
        <tr>
            <td>用户管理</td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
        </tr>
        <tr>
            <td>场站管理</td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
        </tr>
        <tr>
            <td>车辆管理</td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
        </tr>
        <tr>
            <td>设备管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
    </table>
</div>
<div class="table_div" id="power_user" style="display: none;">
    <p class="table_top">
        普通用户&nbsp;&nbsp;&nbsp;权限一览
    </p>
    <table class="table_">
        <tr class="biaoti">
            <td align="center">&nbsp;</td>
            <td>添加</td>
            <td>查询</td>
            <td>修改</td>
            <td>删除</td>
        </tr>
        <tr>
            <td>客户管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
        <tr>
            <td>用户管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
        <tr>
            <td>场站管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
        <tr>
            <td>车辆管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/dui.jpg"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
        <tr>
            <td>设备管理</td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
            <td><img src="../static/images/cuo.gif"/></td>
        </tr>
    </table>
</div>

<input type="hidden" id="uname" value="${uname!""}">

<script src="../static/js/jquery.min.js"></script>
<script src="../static/js/bootstrap.min.js"></script>
<script src="../static/js/user.js"></script>
<script src="../static/js/quanxian.js"></script>
<script src="../static/js/session.js"></script>

<script>

    $(function () {


        $('#aClient').attr("checked","true");
        $('#sClient').attr("checked","true");
        $('#uClient').attr("checked","true");
        $('#dClient').attr("checked","true");

//                $('#aUser').attr("checked","true");
        $('#sUser').attr("checked","true");
//                $('#uUser').attr("checked","true");
        $('#dUser').attr("checked","true");

//                $('#aStation').attr("checked","true");
        $('#sStation').attr("checked","true");
//                $('#uStation').attr("checked","true");
//                $('#dStation').attr("checked","true");

//                $('#aCar').attr("checked","true");
        $('#sCar').attr("checked","true");
//                $('#uCar').attr("checked","true");
//                $('#dCar').attr("checked","true");

        $('#aShebei').attr("checked","true");
        $('#sShebei').attr("checked","true");
        $('#uShebei').attr("checked","true");
//                $('#dShebei').attr("checked","true");

        $('.card-input').change(function () {

//            $('#sCar').attr("checked","false");

            $("input[type='checkbox']").each(function(){
                if(this.checked){
                    this.checked=false;
                }
            });


            var cName = $(this).val();

            if(cName == "超级管理员")
            {
                $('#aClient').attr("checked","true");
                $('#sClient').attr("checked","true");
                $('#uClient').attr("checked","true");
                $('#dClient').attr("checked","true");

//                $('#aUser').attr("checked","true");
                $('#sUser').attr("checked","true");
//                $('#uUser').attr("checked","true");
                $('#dUser').attr("checked","true");

//                $('#aStation').attr("checked","true");
                $('#sStation').attr("checked","true");
//                $('#uStation').attr("checked","true");
//                $('#dStation').attr("checked","true");

//                $('#aCar').attr("checked","true");
                $('#sCar').attr("checked","true");
//                $('#uCar').attr("checked","true");
//                $('#dCar').attr("checked","true");

                $('#aShebei').attr("checked","true");
                $('#sShebei').attr("checked","true");
                $('#uShebei').attr("checked","true");
//                $('#dShebei').attr("checked","true");
            }
            else if(cName == "客户管理员")
            {
//                $('#aClient').attr("checked","true");
//                $('#sClient').attr("checked","true");
//                $('#uClient').attr("checked","true");
//                $('#dClient').attr("checked","true");

                $('#aUser').attr("checked","true");
                $('#sUser').attr("checked","true");
                $('#uUser').attr("checked","true");
                $('#dUser').attr("checked","true");

                $('#aStation').attr("checked","true");
                $('#sStation').attr("checked","true");
                $('#uStation').attr("checked","true");
                $('#dStation').attr("checked","true");

                $('#aCar').attr("checked","true");
                $('#sCar').attr("checked","true");
                $('#uCar').attr("checked","true");
                $('#dCar').attr("checked","true");

//                $('#aShebei').attr("checked","true");
//                $('#sShebei').attr("checked","true");
//                $('#uShebei').attr("checked","true");
//                $('#dShebei').attr("checked","true");
            }
            else
            {
                $('#sCar').attr("checked","true");
            }
        });


        var username = $('#uname').val();
//        alert(username);

        // username = "admin";

        if(username == null || username == '')
        {
            username = 'user';
        }
        //超级管理员
        if(username == 'admin')
        {
            $('#power_admin').show();

            $('#account').val('admin');
            $('#pwd').val('xxxxx');
            $('#power').val('超级管理员');

            $('#power_admin').show();
            $('#power_client').hide();
            $('#power_user').hide();
        }
        //客户管理员
        else if(username == "client")
        {
            $('#power_client').show();
            $('#account').val('client');
            $('#pwd').val('xxxxx');
            $('#power').val('客户管理员');

            $('#kehuMan').hide();
            $('#shebeiMan').hide();

            $('#power_admin').hide();
            $('#power_client').show();
            $('#power_user').hide();

        }
        //用户管理员
        else if(username == "user")
        {
            $('#power_user').show();
            $('#sheet').hide();
            $('#kehuMan').hide();
            $('#userMan').hide();
            $('#shebeiMan').hide();
            $('#stationMan').hide();

            $('#account').val('user');
            $('#pwd').val('xxxxx');
            $('#power').val('用户管理员');

            $('#power_admin').hide();
            $('#power_client').hide();
            $('#power_user').show();

        }
    })

</script>
</body>
</html>
